package com.lovo.view.school;

import com.lovo.javafxComponent.LovoLabel;
import com.lovo.javafxComponent.LovoTitle;
import javafx.scene.control.ButtonBar.ButtonData;
import javafx.scene.control.ButtonType;
import javafx.scene.control.Dialog;
import javafx.scene.layout.Pane;


/**
 * 显示学校信息
 * @author lovo
 *
 */
public class ShowSchoolDialog extends Dialog{
    /**内容容器*/
    private Pane container = new Pane();

    /**学校名称文本框*/
    private LovoLabel nameLabel = new LovoLabel("学校名称", 80, 100,container);
    /**校长文本框*/
    private LovoLabel leaderLabel = new LovoLabel("校长", 80, 150,container);
    /**地址文本框*/
    private LovoLabel addrLabel = new LovoLabel("学校地址", 80, 200,container);
    /**学生人数文本框*/
    private LovoLabel studentCountLabel = new LovoLabel("学生人数", 80, 250,container);
    /**老师人数文本框*/
    private LovoLabel teacherCountLabel = new LovoLabel("老师人数", 80, 300,container);
    /**联系电话文本框*/
    private LovoLabel phoneLabel = new LovoLabel("联系电话", 80, 350,container);
    /**说明文本框*/
    private LovoLabel infoLabel = new LovoLabel("说明", 80, 400,container);
    /**学校主面板*/
    private SchoolPane schoolPane;
    /**
     * 构造方法
     */
    public ShowSchoolDialog(SchoolPane schoolPane) {
        this.schoolPane = schoolPane;
        this.setTitle("显示学校信息");
        initComponent();
    }

    /**
     * 初始化组件
     */
    private void initComponent() {
        new LovoTitle("显示学校信息", -150, 30, container);
        container.setPrefSize(480, 500);
        this.getDialogPane().setContent(container);

        this.initInfo();


        ButtonType cancelButtonType = new ButtonType("关闭", ButtonData.CANCEL_CLOSE);
        this.getDialogPane().getButtonTypes().add(cancelButtonType);

        this.showAndWait();
    }

    //------------------------




    /**
     * 初始化下拉框信息
     */
    private void initInfo() {
        nameLabel.setText("成都市XXX学校");
        leaderLabel.setText("王校长");
        addrLabel.setText("成都市红瓦寺街");
        studentCountLabel.setText("5000");
        teacherCountLabel.setText("200");
        phoneLabel.setText("18088888888");
        infoLabel.setText("无");
    }



}
